Chris Martin scored late on as Scotland saw off Slovenia to keep their slim hopes of reaching the World Cup alive.